#include "AIS_MyPointCloud.h"

#include "Graphic3d_ArrayOfPoints.hxx"

IMPLEMENT_STANDARD_RTTIEXT(AIS_MyPointCloud, AIS_InteractiveObject)

AIS_MyPointCloud::AIS_MyPointCloud():
	myPoints(nullptr)
{
}

void AIS_MyPointCloud::SetPoints(const Handle(Graphic3d_ArrayOfPoints)& thePoints)
{
	myPoints = thePoints;
}


void AIS_MyPointCloud::
Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, 
	const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer aMode)
{
	if (myPoints.IsNull())
		return;

	Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();

	Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(Aspect_TOM_POINT,
		Quantity_Color(185.0 / 255, 121.0 / 255, 2.20 / 255, Quantity_TOC_RGB), 25.0);

	aMarker->SetScale(3.);

	aGroup->SetGroupPrimitivesAspect(aMarker);

	aGroup->AddPrimitiveArray(myPoints);
}



